package ru.nlezhnev.services.request_processor;

import java.sql.Connection;
import java.sql.SQLException;

import ru.nlezhnev.data_models.FarmActionsModel;
import ru.nlezhnev.db.Database;

public class DeleteOldActions extends FarmRequestProcessor {

	public DeleteOldActions(byte[] inputData, String vid, String methodName) {
		super(inputData, vid, methodName);
	}

	protected Object performRequest() throws SQLException {
		Connection conn = Database.getInstance().getConnection();
		FarmActionsModel farmActions = new FarmActionsModel(conn, uid);
		farmActions.deleteActions(System.currentTimeMillis()/1000);
		conn.close();
		return "OK";
	}
}
